package demo1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wwy
 * Date: 2024-11-16
 * Time: 20:11
 */
public class Animal {
      int  a=2;
    public String name;
    int age;

    public Animal(int a, String name, int age) {
        this.a = a;
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Animal eat(){
        System.out.println(this.name+"正在吃饭");
        return null;
    }
    public void sleep(){
        System.out.println(this.name+"正在睡觉");
    }

}
